<template> 
    <AMISRenderer :formId="formId" :schema="schema"></AMISRenderer>
</template>

<script setup>
    import {reactive, watch, ref} from "vue"
    import AMISRenderer from "./AMISRenderer.vue"
    import {useRoute,useRouter} from 'vue-router'

    const route = useRoute()
    const router = useRouter()
    const formId = ref('')
    const schema = ref({})

    watch(()=> router.currentRoute, (data)=>{
            let _router = data.value
            formId.value = _router.id;
            schema.value = JSON.parse(_router.meta.amisSchema);
        },
        {immediate: true,deep: true}
    )
    
</script>